home *** CD-ROM | disk | FTP | other *** search
- ;MASTREXE.ASM B.Kauler
- ;--> MASTREXE.OBJ + SLAVEXE.OBJ + SERF.OBJ --> MASTREXE.EXE
- ;A demonstration of linking .EXE files.
- ;...............................................................
- stack1 segment stack ;'stack' not required on the end.
- db 256 dup(0)
- stack1 ends
- ;...............................................................
- data segment public 'data' ;'data' useful for linker.
- extrn data1:byte
- local_data db "this is local data",0Ah,0Dh,"$"
- data ends
- ;...............................................................
- code segment public 'code' ;'code' useful for linker.
- assume cs:code, ds:data ;tells Assembler default code & data
- ;segments for the instructions to follow.
- extrn slave_routine:near
- master_routine proc far
- mov ax,data ;When prog loads, DS not set to DATA
- mov ds,ax ;segment, so do it here.
- mov dx,offset local_data
- mov ah,9
- int 21h ;display a message.
- ;the interesting bit....
- call slave_routine
- ;interesting here also....
- mov dx,offset data1 ;DATA1 is external.
- mov ah,9
- int 21h ;display message.
- mov al,0
- mov ah,4Ch
- int 21h ;back to DOS
- master_routine endp
- code ends
- end master_routine